# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>

pkgname=nmap
pkgver=7.70
pkgrel=2
pkgdesc='Utility for network discovery and security auditing'
url='http://nmap.org/'
arch=('x86_64')
license=('GPL2')
makedepends=('pygtk')
optdepends=('pygtk: zenmap'
            'sudo: privilege escalation for zenmap'
            'xterm: privilege escalation for zenmap'
            'kde-cli-tools: privilege escalation for zenmap')
depends=('pcre' 'openssl' 'lua52')
validpgpkeys=('436D66AB9A798425FDA0E3F801AF9F036B9355D0')
source=("https://nmap.org/dist/${pkgname}-${pkgver}.tar.bz2"
        "https://nmap.org/dist/sigs/${pkgname}-${pkgver}.tar.bz2.asc")
sha256sums=('847b068955f792f4cc247593aca6dc3dc4aae12976169873247488de147a6e18'
            'SKIP')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	export PYTHON=python2
	./configure \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--mandir=/usr/share/man \
		--with-libpcap=included \

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	rm "${pkgdir}"/usr/bin/uninstall_*
	install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	python2 -m compileall "${pkgdir}"/usr/lib/python2.7/site-packages/zenmapCore
}
